<?php

class Newuser_model extends CI_Model {

    function __construct() {
        parent::__construct();
    }

    public function insert_new_user($uid, $token) {
        $this->db->select('uid');
        $this->db->from('wb_task_network');
        $this->db->where('uid', $uid);
        $query = $this->db->get();
        if ($query->num_rows() == 0) {
            $data = array(
                'uid' => $uid,
                'token_key' => $token,
                'type' => '0'
            );
            $this->db->insert('wb_task_network', $data);
        }
    }

}

?>
